/**
 * @author banglong
 * @date 2016/9/22.
 */
define([''], function () {

    var getBillTableColumnNames = function (isGYKS, BillType) {
        var columnNames;
        switch (BillType) {
            case 'ly':
                if (isGYKS) {
                    columnNames = ['单据流水号', '状态', '出库科室', '入库科室', '所在楼号', '录入人', '录入日期', '发送人', '发送日期', '审核人', '审核日期', '出库人', '出库日期'];
                } else {
                    columnNames = ['单据流水号', '录入时间', '登帐日期', '单据状态', '领用科室', '录入人', '审核人', '登帐人'];
                }
                break;
            case 'zy':
                columnNames = ['单据流水号', '录入时间', '登帐日期', '单据状态', '转入科室', '转出科室', '录入人', '审核人', '登帐人'];
                break;
            case 'jh':
                columnNames = ['单据流水号', '录入时间', '登帐日期', '单据状态', '缴回科室', '录入人', '审核人', '登帐人'];
                break;
            case 'dh':
            case 'jy':
                columnNames = ['单据流水号', '申请科室名称', '状态', '发送人', '发送时间', '收污人', '收污时间', '发包人', '发包时间', '录入人', '录入时间', '申请账户名称'];
                break;
            case 'qxxd':
                columnNames = ['单据流水号', '申请科室', '发送人', '发送时间', '状态'];
                break;
            case 'sq':
                columnNames = ['单据流水号', '病区名称', '申请人', '申请时间', '发送人', '发送时间', '状态'];
                break;
            case 'ygsq':
                columnNames = ['单据流水号', '病区名称', '申请人', '申请时间', '发送人', '发送时间', '状态'];
                break;
        }
        return columnNames;
    };

    var getBillTableColumnValueNames = function (isGYKS, BillType) {
        var ColumnValueNames;
        switch (BillType) {
            case 'ly':
                if (isGYKS) {
                    //'单据流水号', '状态', '出库科室', '入库科室', '所在楼号', '录入人', '发送人', '发送日期', '审核人', '审核日期', '出库人', '出库日期'
                    ColumnValueNames = ['BillSN', 'strStatus', 'OutDeptName', 'InDeptName', 'SZLH', 'InputUserName', 'InputTime', 'SendUserName', 'SendTime', 'AuditUserName', 'AuditTime', 'DiliverUserName', 'DiliverTime'];
                } else {
                    ColumnValueNames = ['BillSN', 'InputTime', 'AcceptTime', 'strStatus', 'InDeptName', 'InputUserName', 'AuditUserName', 'AcceptUserName'];
                }
                break;
            case 'zy':
                ColumnValueNames = ['BillSN', 'InputTime', 'AcceptTime', 'strStatus', 'InDeptName', 'OutDeptName', 'InputUserName', 'AuditUserName', 'AcceptUserName'];
                break;
            case 'jh':
                ColumnValueNames = ['BillSN', 'InputTime', 'AcceptTime', 'strStatus', 'OutDeptName', 'InputUserName', 'AuditUserName', 'AcceptUserName'];
                break;
            case 'dh':
            case 'jy':
                ColumnValueNames = ['BillSN', 'ApplyDeptName', 'strStatus', 'SendUserName', 'SendTime', 'LastCollectUserName', 'LastCollectTime', 'SendPackUserName', 'SendPackTime', 'InputUserName', 'InputTime', 'ApplyDeptAccountName'];
                break;
            case 'qxxd':
                ColumnValueNames = ['BillSN', 'DeptName', 'SendUserName', 'SendTime', 'strStatus'];
                break;
            case 'sq':
                ColumnValueNames = ['BillSN', 'DeptName', 'Sqrmc', 'sqsj', 'Fsrxm', 'fssj', 'strStatus'];
                break;
            case 'ygsq':
                ColumnValueNames = ['BillSN', 'DeptName', 'Sqrmc', 'sqsj', 'Fsrxm', 'fssj', 'strStatus'];
                break;
        }
        return ColumnValueNames;
    };

    var getNewBillTableColumnNames = function (isGYKS, BillType) {
        var columnNames;
        switch (BillType) {
            case 'ly':
                if (isGYKS) {
                    columnNames = ['物品代码', '物品名称', '规格型号', '计量单位', '申请数', '库存', '参考单价', '实发数', '操作'];
                } else {
                    columnNames = ['物品代码', '物品名称', '规格型号', '计量单位', '申请数', '库存', '参考单价', '参考金额', '备注', '卡片号列表', '收费代码', '实发数', '操作'];
                }
                break;
            case 'zy':
                columnNames = ['物品代码', '物品名称', '规格型号', '计量单位', '申请数', '库存', '参考单价', '参考金额', '备注', '卡片号列表', '收费代码', '操作'];
                break;
            case 'jh':
                columnNames = ['物品代码', '物品名称', '规格型号', '计量单位', '申请数', '库存', '参考单价', '参考金额', '备注', '卡片号列表', '收费代码', '操作'];
                break;
            case 'dh':
            case 'jy':
                columnNames = ['包代码', '包名称', '申请数', '实发数', '已收污数', '操作'];
                break;
            case 'qxxd':
                columnNames = ['物品代码', '物品名称', '申请数', '实发数', '实收数', '操作'];
                break;
            case 'sq':
                columnNames = ['物品代码', '物品名称', '物品规格', '单位', '参考单价', '申请数量', '申请金额', '备注', '操作'];
                break;
            case 'ygsq':
                columnNames = ['物品代码', '物品名称', '物品规格', '单位', '参考单价', '申请数量', '申请金额', '备注', '操作'];
                break;
        }
        return columnNames;
    };

    var getNewBillTableColumnValueNames = function (isGYKS, BillType) {
        var ColumnValueNames;
        switch (BillType) {
            case 'ly':
                if (isGYKS) {
                    ColumnValueNames = ['GoodsCode', 'GoodsName', 'GoodsSpec', 'BoxUnit', 'ApplyNum', 'GoodsCount', 'RefPrice', 'ApplyNum'];
                } else {
                    ColumnValueNames = ['GoodsCode', 'GoodsName', 'GoodsSpec', 'BoxUnit', 'ApplyNum', 'GoodsCount', 'RefPrice', 'consultMoney', 'Comment', 'CardNumberList', 'ChargeCode', 'ActualSendNum'];
                }
                break;
            case 'zy':
            case 'jh':
                ColumnValueNames = ['GoodsCode', 'GoodsName', 'GoodsSpec', 'BoxUnit', 'ApplyNum', 'GoodsCount', 'RefPrice', 'consultMoney', 'Comment', 'CardNumberList', 'ChargeCode'];
                break;
            case 'dh':
            case 'jy':
                ColumnValueNames = ['PackageCode', 'PackageName', 'Counts', 'ActualCount', 'ToCollectNum'];
                break;
            case 'qxxd':
                ColumnValueNames = ['GoodsCode', 'GoodsName', 'ApplyCounts', 'ActualCounts', 'ActualSendCounts'];
                break;
            case 'sq':
                ColumnValueNames = ['GoodsCode', 'GoodsName', 'GoodsSpec', 'Unit', 'Price', 'sqsl', 'Amount', 'bz'];
                break;
            case 'ygsq':
                ColumnValueNames = ['GoodsCode', 'GoodsName', 'GoodsSpec', 'Unit', 'Price', 'sqsl', 'Amount', 'bz'];
                break;
        }
        return ColumnValueNames;
    };

    var getStockSearchColumnNames = function () {
        return ['账户名称', '物品代码', '物品名称', '物品规格', '是否流通', '设备科标志', '单价', '数量'];
    };

    var getStockSearchColumnValueNames = function () {
        return ['DeptAccountName', 'GoodsID', 'GoodsName', 'GoodsSpec', 'IsOpen', 'IsImmediatelyUse', 'CurrentPrice', 'Counts'];
    };

    var getChooseConditionsColumnNames = function (type) {
        var ColumnNames;
        switch (type) {
            case 0:
                ColumnNames = ['科室账户名称', '拼音码', '改革办序号', '保管人姓名', '截止科室标志', '供应科室标志', '承包科室标志', '成本核算科室标志'];
                break;
            case 1:
                ColumnNames = ['账册名称', '账册代码', '拼音码', '维护科室名称'];
                break;
            case 2:
                ColumnNames = ['大类名称', '大类代码', '拼音码'];
                break;
            case 3:
                ColumnNames = ['中类名称', '中类代码', '拼音码'];
                break;
            case 4:
                ColumnNames = ['小类名称', '小类代码', '拼音码'];
                break;
            case 5:
                ColumnNames = ['分组名称', '分组编号', '拼音缩写'];
                break;
            case 6:
                ColumnNames = ['大类名称', '大类代码', '拼音缩写', '是否来自设备科'];
                break;
        }
        return ColumnNames;
    };

    var getChooseConditionsColumnValueNames = function (type) {
        var ColumnValueNames;
        switch (type) {
            case 0:
                ColumnValueNames = ['DeptAccountName', 'PyCode', 'Ggbxh', 'BgrName', 'IsJzks', 'IsProviderAccount', 'IsCbks', 'IsCbhsks'];
                break;
            case 1:
                ColumnValueNames = ['GoodsBookName', 'GoodsBookCode', 'PyCode', 'DeptAccountName'];
                break;
            case 2:
                ColumnValueNames = ['GoodsBigCatName', 'GoodsBigCatCode', 'PyCode'];
                break;
            case 3:
                ColumnValueNames = ['GoodsMidCatName', 'GoodsMidCatCode', 'PyCode'];
                break;
            case 4:
                ColumnValueNames = ['GoodsSmallCatName', 'GoodsSmallCatCode', 'PyCode'];
                break;
            case 5:
                ColumnValueNames = ['GroupName', 'GroupSN', 'Pycode'];
                break;
            case 6:
                ColumnValueNames = ['PackageBigCatName', 'PackageBigCatCode', 'PyCode', 'HaveStock'];
                break;
        }
        return ColumnValueNames;
    };

    // 颜色说明
    var setColorDescription = function (runtimeParam, billListVm) {
        switch (runtimeParam.BillType) {
            case 'sq':
                billListVm.colorDescription = '<li><img src="img/index/u431.png"/><span>申请</span></li>'
                    + '<li><img src="img/index/u435.png"/><span>发送</span></li>'
                    + '<li><img src="img/index/u453.png"/><span>作废/删除</span></li>'
                    + '<li><img src="img/index/u880.png"/><span>汇总</span></li>';
                break;
            case 'dh':
            case 'jy':
                billListVm.colorDescription = '<li><img src="img/index/u431.png"/><span>录入</span></li>'
                    + '<li><img src="img/index/u435.png"/><span>发送</span></li>'
                    + '<li><img src="img/index/u453.png"/><span>作废</span></li>'
                    + '<li><img src="img/index/u449.png"/><span>完全收污</span></li>'
                    + '<li><img src="img/index/u880.png"/><span>发包</span></li>';
                break;
            case 'qxxd':
                billListVm.colorDescription = '<li><img src="img/index/u431.png"/><span>录入</span></li>'
                    + '<li><img src="img/index/u449.png"/><span>发送</span></li>'
                    + '<li><img src="img/index/u441.png"/><span>收污</span></li>'
                    + '<li><img src="img/index/u880.png"/><span>发包</span></li>'
                    + '<li><img src="img/index/u453.png"/><span>作废</span></li>';
                break;
            default:
                billListVm.colorDescription = '<li><img src="img/index/u431.png"/><span>已录入</span></li>'
                    + '<li><img src="img/index/u435.png"/><span>发送</span></li>'
                    + '<li><img src="img/index/u441.png"/><span>审核</span></li>'
                    + '<li><img src="img/index/u445.png"/><span>登账</span></li>'
                    + '<li><img src="img/index/u449.png"/><span>结账</span></li>'
                    + '<li><img src="img/index/u453.png"/><span>作废</span></li>';
                break;
        }
    };

    var setStatus = function (billListVm, runtimeParam) {
        billListVm.statusStr['lr'] = runtimeParam.statusStr['lr'] = '录入';
        billListVm.statusStr['fs'] = runtimeParam.statusStr['fs'] = '发送';
        billListVm.statusStr['sh'] = runtimeParam.statusStr['sh'] = '审核';
        billListVm.statusStr['ck'] = runtimeParam.statusStr['ck'] = '出库';
        billListVm.statusStr['rk'] = runtimeParam.statusStr['rk'] = '登帐';
        billListVm.statusStr['jz'] = runtimeParam.statusStr['jz'] = '结账';
        billListVm.statusStr['zf'] = runtimeParam.statusStr['zf'] = '作废';
        billListVm.statusStr['fb'] = runtimeParam.statusStr['fb'] = '发包状态';
        billListVm.statusStr['bs'] = runtimeParam.statusStr['bs'] = '部分收污';
        billListVm.statusStr['sh'] = runtimeParam.statusStr['sh'] = '审核';
        billListVm.statusStr['xd'] = runtimeParam.statusStr['xd'] = '收污';

        switch (billListVm.BillType) {
            case 'dh':
            case 'jy':
                billListVm.statusStr['sh'] = runtimeParam.statusStr['sh'] = '完全收污';
                break;
            case 'qxxd':
                billListVm.statusStr['sh'] = runtimeParam.statusStr['sh'] = '发包';
                break;
        }
    };

    var getStatusArr = function (BillType) {
        var statusArr = [];
        switch (BillType) {
            case 'ly':
            case 'jh':
            case 'zy':
                statusArr = [
                    {value: 'lr', text: '已录入'},
                    {value: 'fs', text: '已发送'},
                    {value: 'sh', text: '已审核'},
                    {value: 'rk', text: '已登帐'},
                    {value: 'jz', text: '已结账'},
                    {value: 'zf', text: '已作废'}
                ];
                break;
            case 'dh':
            case 'jy':
                statusArr = [
                    {value: 'lr', text: '录入状态'},
                    {value: 'fs', text: '发送状态'},
                    {value: 'zf', text: '作废状态'},
                    {value: 'fb', text: '发包状态'},
                    {value: 'sh', text: '完全收污'}
                ];
                break;
            case 'qxxd':
                statusArr = [
                    {value: 'lr', text: '已录入'},
                    {value: 'fs', text: '已发送'},
                    {value: 'xd', text: '已收污'},
                    {value: 'sh', text: '已发包'},
                    {value: 'zf', text: '已作废'}
                ];
                break;
        }
        return statusArr;
    };

    return {
        getBillTableColumnNames: getBillTableColumnNames,
        getBillTableColumnValueNames: getBillTableColumnValueNames,
        getNewBillTableColumnNames: getNewBillTableColumnNames,
        getNewBillTableColumnValueNames: getNewBillTableColumnValueNames,
        getStockSearchColumnNames: getStockSearchColumnNames,
        getStockSearchColumnValueNames: getStockSearchColumnValueNames,
        getChooseConditionsColumnNames: getChooseConditionsColumnNames,
        getChooseConditionsColumnValueNames: getChooseConditionsColumnValueNames,
        setColorDescription: setColorDescription,
        setStatus: setStatus,
        getStatusArr: getStatusArr
    };
});